package org.dmd.concinnity.server.generated.dmw;

// Generated from: org.dmd.util.codegen.ImportManager.getFormattedImports(ImportManager.java:82)
// Called from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:442)
import java.util.ArrayList;                                                   // To support getMVCopy() - (BaseDMWGenerator.java:1181)
import org.dmd.concinnity.server.extended.Concept;                            // Required for getModificationRecorder() - (BaseDMWGenerator.java:1076)
import org.dmd.concinnity.server.extended.ConcinnityDefinition;               // Derived class - (BaseDMWGenerator.java:1248)
import org.dmd.concinnity.server.generated.dmw.ConceptIterableDMW;            // For multi-valued Concept - (BaseDMWGenerator.java:1709)
import org.dmd.concinnity.shared.generated.dmo.ConceptDMO;                    // Class not auxiliary or abstract - (BaseDMWGenerator.java:1252)
import org.dmd.concinnity.shared.generated.dmo.DmconcinnityDMSAG;             // Attribute isLike from the dmconcinnity schema - (BaseDMWGenerator.java:897)
import org.dmd.concinnity.shared.generated.types.ConceptREF;                  // Is reference type REF - (BaseDMWGenerator.java:1115)
import org.dmd.concinnity.shared.generated.types.ConcinnityModuleREF;         // Required to access defined in module name - (DMWGenerator.java:181)
import org.dmd.dmc.*;                                                         // If any attributes - (BaseDMWGenerator.java:1087)
import org.dmd.dmc.definitions.DmcDefinitionIF;                               // The object is a domain specific definition - (BaseDMWGenerator.java:411)
import org.dmd.dmc.types.DefinitionName;                                      // Is named by - (BaseDMWGenerator.java:1062)
import org.dmd.dms.ClassDefinition;                                           // Passing derived class def up the hierarchy - (BaseDMWGenerator.java:1067)
import org.dmd.dms.generated.dmo.MetaDMSAG;                                   // Required for MODREC constructor - (BaseDMWGenerator.java:1072)
import org.dmd.dms.generated.types.DmcTypeModifierMV;                         // Required for MODREC constructor - (BaseDMWGenerator.java:1071)



/**
 * The Concept class provides a flexible mechanism for defining concepts that
 * can be\n linked in arbitrary or structured ways to other concepts.
 * Concepts allow other, disparate information\n from other dark-matter
 * Domain Specific Languages (DSLs) to be linked together at a conceptual
 * level.\n <p/>\n How you use this mechanism is bounded only by your
 * imagination.
 * <P>
 * Generated from the dmconcinnity schema at version unknown
 * <P>
 * This code was auto-generated by the dmggenerator utility and shouldn't be alterred manually!
 * Generated from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:479)
 */
abstract public class ConceptDMW extends ConcinnityDefinition implements DmcDefinitionIF, DmcNamedObjectIF {

    // Generated from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:558)
    public ConceptDMW() {
        super(new ConceptDMO(), org.dmd.concinnity.server.generated.DmconcinnitySchemaAG._Concept);
    }

    // Generated from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:564)
    public ConceptDMW(DmcTypeModifierMV mods) {
        super(new ConceptDMO(mods), org.dmd.concinnity.server.generated.DmconcinnitySchemaAG._Concept);
    }

    // Generated from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:606)
    public Concept getModificationRecorder(){
        Concept rc = new Concept();
        rc.setName(getName());
        rc.setModifier(new DmcTypeModifierMV(MetaDMSAG.__modify));
        return(rc);
    }

    // Generated from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:627)
    public ConceptDMW(ConceptDMO obj) {
        super(obj, org.dmd.concinnity.server.generated.DmconcinnitySchemaAG._Concept);
    }

    public Concept cloneIt() {
        Concept rc = new Concept();
        rc.setDmcObject(getDMO().cloneIt());
        return(rc);
    }

    public ConceptDMO getDMO() {
        return((ConceptDMO) core);
    }

    // Generated from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:642)
    protected ConceptDMW(ConceptDMO obj, ClassDefinition cd) {
        super(obj,cd);
    }

    // org.dmd.dmg.generators.BaseDMWGenerator.getAccessFunctions(BaseDMWGenerator.java:1297)
    public DefinitionName getObjectName(){
        return(((ConceptDMO) core).getName());
    }

    public int hashCode(){
        return(getObjectName().hashCode());
    }

    public DmcAttribute<?> getObjectNameAttribute(){
        return(((ConceptDMO) core).getObjectNameAttribute());
    }

    public boolean equals(Object obj){
        if (obj instanceof ConceptDMW){
            return( getObjectName().equals( ((ConceptDMW) obj).getObjectName()) );
        }
        return(false);
    }

    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1474)
    public String getHint(){
        return(((ConceptDMO) core).getHint());
    }

    /**
     * Sets hint to the specified value.
     * @param value A value compatible with DmcTypeString
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1584)
    public void setHint(Object value) throws DmcValueException {
        ((ConceptDMO) core).setHint(value);
    }

    /**
     * Sets hint to the specified value.
     * @param value String
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1593)
    public void setHint(String value){
        ((ConceptDMO) core).setHint(value);
    }

    /**
     * Removes the hint attribute value.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1619)
    public void remHint(){
        ((ConceptDMO) core).remHint();
    }

    /**
     * @return A Concept object.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1434)
    public Concept getIs(){
        ConceptREF ref = ((ConceptDMO) core).getIs();
        if (ref == null)
            return(null);
        
        if (ref.getObject() == null)
            return(null);
        
        return((Concept)ref.getObject().getContainer());
    }

    /**
     * Sets the is to the specified value.
     * @param value A value compatible with ConceptREF
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1519)
    public void setIs(Concept value) {
        ((ConceptDMO) core).setIs(value.getDMO());
    }

    /**
     * Sets the is to the specified value.
     * @param value A value compatible with ConceptREF
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1528)
    public void setIs(Object value) throws DmcValueException {
        ((ConceptDMO) core).setIs(value);
    }

    /**
     * Removes the is attribute value.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1619)
    public void remIs(){
        ((ConceptDMO) core).remIs();
    }

    /**
     * @return The number of Concept items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1671)
    public int getIsLikeSize(){
        return(((ConceptDMO) core).getIsLikeSize());
    }

    /**
     * @return true if there are no ConceptDMO items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1679)
    public boolean getIsLikeIsEmpty(){
        if (((ConceptDMO) core).getIsLikeSize() == 0)
            return(true);
        return(false);
    }

    /**
     * @return true if there are any ConceptDMO items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1689)
    public boolean getIsLikeHasValue(){
        if (((ConceptDMO) core).getIsLikeSize() == 0)
            return(false);
        return(true);
    }

    /**
     * @return An Iterator of ConceptDMO objects.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1716)
    public ConceptIterableDMW getIsLikeIterable(){
        DmcAttribute<?> attr = core.get(DmconcinnityDMSAG.__isLike);
        if (attr == null)
            return(ConceptIterableDMW.emptyList);
        
        return(new ConceptIterableDMW(((ConceptDMO) core).getIsLike()));
    }

    /**
     * Adds another isLike value.
     * @param value A value compatible with Concept
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1773)
    public DmcAttribute<?> addIsLike(Concept value){
        DmcAttribute<?> attr = ((ConceptDMO) core).addIsLike(((ConceptDMO)value.getDmcObject()));
        return(attr);
    }

    /**
     * Deletes a isLike value.
     * @param value The Concept to be deleted from set of attribute values.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1823)
    public void delIsLike(Concept value){
        ((ConceptDMO) core).delIsLike(value.getDMO());
    }

    /**
     * @return A COPY of the collection of Concept objects.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1887)
    public ArrayList<Concept> getIsLikeCopy(){
        DmcAttribute<?> attr = ((ConceptDMO) core).get(DmconcinnityDMSAG.__isLike);
        if (attr == null)
            return(new ArrayList<Concept>());
        
        ArrayList<Concept> rc = new ArrayList<Concept>(attr.getMVSize());
        
        ConceptIterableDMW it = getIsLikeIterable();
        while(it.hasNext()){
            rc.add(it.next());
        }
        
        return(rc);
    }

    /**
     * Removes the isLike attribute value.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:2292)
    public void remIsLike(){
        ((ConceptDMO) core).remIsLike();
    }

    /**
     * @return The number of Concept items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1671)
    public int getIsRelatedToSize(){
        return(((ConceptDMO) core).getIsRelatedToSize());
    }

    /**
     * @return true if there are no ConceptDMO items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1679)
    public boolean getIsRelatedToIsEmpty(){
        if (((ConceptDMO) core).getIsRelatedToSize() == 0)
            return(true);
        return(false);
    }

    /**
     * @return true if there are any ConceptDMO items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1689)
    public boolean getIsRelatedToHasValue(){
        if (((ConceptDMO) core).getIsRelatedToSize() == 0)
            return(false);
        return(true);
    }

    /**
     * @return An Iterator of ConceptDMO objects.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1716)
    public ConceptIterableDMW getIsRelatedToIterable(){
        DmcAttribute<?> attr = core.get(DmconcinnityDMSAG.__isRelatedTo);
        if (attr == null)
            return(ConceptIterableDMW.emptyList);
        
        return(new ConceptIterableDMW(((ConceptDMO) core).getIsRelatedTo()));
    }

    /**
     * Adds another isRelatedTo value.
     * @param value A value compatible with Concept
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1773)
    public DmcAttribute<?> addIsRelatedTo(Concept value){
        DmcAttribute<?> attr = ((ConceptDMO) core).addIsRelatedTo(((ConceptDMO)value.getDmcObject()));
        return(attr);
    }

    /**
     * Deletes a isRelatedTo value.
     * @param value The Concept to be deleted from set of attribute values.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1823)
    public void delIsRelatedTo(Concept value){
        ((ConceptDMO) core).delIsRelatedTo(value.getDMO());
    }

    /**
     * @return A COPY of the collection of Concept objects.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1887)
    public ArrayList<Concept> getIsRelatedToCopy(){
        DmcAttribute<?> attr = ((ConceptDMO) core).get(DmconcinnityDMSAG.__isRelatedTo);
        if (attr == null)
            return(new ArrayList<Concept>());
        
        ArrayList<Concept> rc = new ArrayList<Concept>(attr.getMVSize());
        
        ConceptIterableDMW it = getIsRelatedToIterable();
        while(it.hasNext()){
            rc.add(it.next());
        }
        
        return(rc);
    }

    /**
     * Removes the isRelatedTo attribute value.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:2292)
    public void remIsRelatedTo(){
        ((ConceptDMO) core).remIsRelatedTo();
    }

    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1474)
    public DefinitionName getName(){
        return(((ConceptDMO) core).getName());
    }

    /**
     * Sets name to the specified value.
     * @param value A value compatible with DmcTypeDefinitionName
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1584)
    public void setName(Object value) throws DmcValueException {
        ((ConceptDMO) core).setName(value);
    }

    /**
     * Sets name to the specified value.
     * @param value DefinitionName
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1593)
    public void setName(DefinitionName value){
        ((ConceptDMO) core).setName(value);
    }

    /**
     * Removes the name attribute value.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1619)
    public void remName(){
        ((ConceptDMO) core).remName();
    }

    /**
     * @return A Concept object.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1434)
    public Concept getRepresents(){
        ConceptREF ref = ((ConceptDMO) core).getRepresents();
        if (ref == null)
            return(null);
        
        if (ref.getObject() == null)
            return(null);
        
        return((Concept)ref.getObject().getContainer());
    }

    /**
     * Sets the represents to the specified value.
     * @param value A value compatible with ConceptREF
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1519)
    public void setRepresents(Concept value) {
        ((ConceptDMO) core).setRepresents(value.getDMO());
    }

    /**
     * Sets the represents to the specified value.
     * @param value A value compatible with ConceptREF
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1528)
    public void setRepresents(Object value) throws DmcValueException {
        ((ConceptDMO) core).setRepresents(value);
    }

    /**
     * Removes the represents attribute value.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1619)
    public void remRepresents(){
        ((ConceptDMO) core).remRepresents();
    }

    // Generated from: org.dmd.dmg.generators.DMWGenerator.dumpAdditionalWrapperFunctions(DMWGenerator.java:222)
    /**
     * This method indicates the name of the module from which this definition was loaded.
     */
    @Override
    public String getNameOfModuleWhereThisCameFrom(){
        ConcinnityModuleREF ref = ((ConceptDMO) core).getDefinedInConcinnityModule();
        return(ref.getName().getNameString());
    }


}
